import { createElement, HTMLAttributes, type FC } from 'react';
import classNames from 'classnames';

import { feedSummaryDefaultProps } from './defaultProps';
import type { FeedSummaryOptions } from './type';

export interface FeedSummaryProps extends FeedSummaryOptions, HTMLAttributes<HTMLDivElement> {}

const FeedSummary: FC<FeedSummaryProps> = (props) => {
  const { className, children, forwardedRef, ...feedSummaryProps } = props;

  return createElement(
    'div',
    { ref: forwardedRef, className: classNames('summary', className), ...feedSummaryProps },
    children,
  );
};

FeedSummary.displayName = 'FeedSummary';
FeedSummary.defaultProps = feedSummaryDefaultProps;

export default FeedSummary;
